<h2>Why is this an issue?</h2>
<p>Methods that are never executed are dead code and should be removed. Cleaning out dead code decreases the size of the maintained codebase, making
it easier to understand the program and preventing bugs from being introduced.</p>
<p>When using React class components, all non-React lifecycle methods should be called within the scope of the component. If a method is only called
from outside the class, consider using <code>props</code> to interact with the component and re-render if needed, as React encourages data-driven
components.</p>
<pre data-diff-id="1" data-diff-type="noncompliant">
class Profile extends React.Component {
  render(props) {
    return &lt;h1&gt;{ props.name }&lt;/h1&gt;;
  }

  getDefaultName() { // Noncompliant: this method is never used and is a dead code
    return 'John Smith';
  }
}
</pre>
<p>To fix the issue, remove the dead code or call the method from within the component scope.</p>
<pre data-diff-id="1" data-diff-type="compliant">
class Profile extends React.Component {
  render(props) {
    return &lt;h1&gt;{ props.name || getDefaultName() }&lt;/h1&gt;;
  }

  getDefaultName() {
    return 'John Smith';
  }
}
</pre>
<h2>Resources</h2>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://github.com/jsx-eslint/eslint-plugin-react">eslint-plugin-react</a> - Rule <a
  href="https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-class-component-methods.md">no-unused-class-component-methods</a> </li>
  <li> React Documentation - <a href="https://reactjs.org/docs/components-and-props.html">Components and Props</a> </li>
  <li> React Documentation - <a href="https://legacy.reactjs.org/docs/state-and-lifecycle.html#adding-lifecycle-methods-to-a-class">Adding Lifecycle
  Methods to a Class</a> </li>
</ul>
